
#region Imported Namespaces
using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;

using PHSRAG.Insight21.SearchContext;
using Calendar = PHSRAG.WebControls.Calendar;
using Constants = PHSRAG.Insight21.InsightUtilities.Constants;
using DataAccess = PHSRAG.Utility.DataAccess;
using SessionCachePolicy = PHSRAG.Insight21.Policy.SessionCachePolicy;
using Policy = PHSRAG.Insight21.Policy;
using UserContext = PHSRAG.Insight21.Context.UserContext;
#endregion

namespace PHSRAG.Insight21.InsightWebControls
{
	#region Class AgreementSearch
	/// <summary>
	/// The AgreementSearch control is used by Agreement summary pages.
	/// </summary>
	[ToolboxData("<{0}:AgreementSearch runat=server />"), Designer(typeof(AgreementSearchDesigner))]
	public class AgreementSearch : BaseSearch, INamingContainer, ISearch
	{
		#region Instance Variables
        private const string AllFundStatus = "0";
        private const string ActiveFundStatus = "1";
		private const string AwardedAgreementStatus = "3";
		#endregion

		#region Instance Variables
		private DropDownList activityType;
		private DropDownList agreementType;
		private DropDownList daysFundCreated;
		private TextBox balanceLessThan;
        private TextBox balanceGreaterThan;
		private RegularExpressionValidator balanceLessThanValidator;
        private RegularExpressionValidator balanceGreaterThanValidator;
		private TextBox bicsNumber;
		private Calendar budgetEndDate;
		private Calendar budgetStartDate;
        private Calendar ProjectEndFrom;
        private Calendar ProjectEndTo;
        private Calendar budgetEndFrom;
        private Calendar budgetEndTo;
		private Policy.ICachePolicy cachePolicy;
		private ControlCollection controlCollection;
		private DropDownList daysBudgetEnding;
		private DropDownList daysProjectEnding;
		private Calendar distributionEndDate;
		private Calendar distributionStartDate;
		private TextBox firstName;
		private TextBox folderNumber;
		private CheckBox includeProgramProjects;
        private TextBox projectTitle;
        private bool isSearchableByBalance = true;
		private bool isSearchableByDistributionDates;
		private bool isSearchableByName;
		private bool showDefaultFund;
		private bool showDefaultAgreement;
		private TextBox lastName;
		private DropDownList location;
		private Calendar projectEndDate;
		private Calendar projectStartDate;
		private TextBox sponsorName;
		private DropDownList sponsorType;
        private DropDownList viewType;
		private DropDownList fundStatus;
		private DropDownList agreementStatus;
		private TextBox walkerNumber;
        private TextBox sponsorNumber;
        private TextBox documentId;
		#endregion

		#region ISearch Members
		/// <summary>
		/// Reset the internal search state. This involves setting the value for all controls to their default values
		/// and resetting the cached state of the search context.
		/// </summary>
		public void Reset()
		{
			ResetControls(controlCollection);

			projectStartDate.Reset();
			projectEndDate.Reset();
			budgetStartDate.Reset();
			budgetEndDate.Reset();
			if (isSearchableByDistributionDates)
			{
				distributionStartDate.Reset();
				distributionEndDate.Reset();
			}

            if (fundStatus.Enabled)
                fundStatus.SelectedValue = ActiveFundStatus;
		}

		/// <summary>
		/// Get the search criteria from the common search context.
		/// </summary>
		public SearchCriteria SearchCriteria
		{
			get
			{
				return ((AgreementSearchContext)cachePolicy.GetCachedObject(AgreementSearchContext.CacheKey)).GetSearchCriteria(Page.Request.Url.ToString());
			}
		}


		/// <summary>
		/// Get the search criteria. This is done by collecting the current values in all controls, storing them in the
		/// AgreementSearchContext, and then returning the search criteria.
		/// </summary>
		public SearchCriteria UpdateSearchCriteria()
		{
			UserContext userContext = (UserContext)cachePolicy.GetCachedObject(UserContext.CacheKey);
			return GetSearchCriteria(userContext.DomainUserId, controlCollection);
		}
		#endregion

		#region Public Properties
		/// <summary>
		/// Get/Set whether balance less than input box should be made available.
		/// </summary>
		[Bindable(true), Category("Appearance"), DefaultValue(false), Description("Display text box for balance less than")]
		public bool IsSearchableByBalance
		{
			get { return isSearchableByBalance; }
			set { isSearchableByBalance = value; }
		}

		/// <summary>
		/// Get/Set whether to display calendars for distribution start and end dates.
		/// </summary>
		[Bindable(true), Category("Appearance"), DefaultValue(true), Description("Display calendars for employee distribution start and end dates")]
		public bool IsSearchableByDistributionDates
		{
			get { return isSearchableByDistributionDates; }
			set { isSearchableByDistributionDates = value; }
		}

		/// <summary>
		/// Get/Set whether last name and first name input boxes should be made available.
		/// </summary>
		[Bindable(true), Category("Appearance"), DefaultValue(false), Description("Display text boxes for Name input")]
		public bool IsSearchableByName
		{
			get { return isSearchableByName; }
			set { isSearchableByName = value; }
		}

		/// <summary>
		/// Get/Set whether Fund Status should be set to a default value.
		/// </summary>
		[Bindable(true), Category("Appearance"), DefaultValue(false), Description("Assign a default value to Fund Status")]
		public bool ShowDefaultFund
		{
			get { return showDefaultFund; }
			set { showDefaultFund = value; }
		}

		/// <summary>
		/// Get/Set whether Agreement Status should be set to a default value.
		/// </summary>
		[Bindable(true), Category("Appearance"), DefaultValue(false), Description("Assign a default value to Agreement Status")]
		public bool ShowDefaultAgreement
		{
			get { return showDefaultAgreement; }
			set { showDefaultAgreement = value; }
		}
		#endregion

		#region Protected Properties
		/// <summary>
		/// Determine if the control is in design mode. It is if there is not HTTP context.
		/// </summary>
		protected static bool IsDesignMode
		{
			get { return HttpContext.Current == null; }
		}
		#endregion

		#region Virtual Methods
		/// <summary>
		/// Invoked by the method which builds the HTML representation of the control tree. Derived classes would typically
		/// return the HTML to be inserted into the stream AFTER the indicated row.
		/// </summary>
		/// <param name="currentRowNumber">The number (starting from 1) of the row that the HTML returned by this method
		/// would be inserted at.
		/// </param>
		/// <returns>HTML string to add at row number currentRowNumber</returns>
		protected virtual string GetHTML(int currentRowNumber)
		{
			return string.Empty;
		}
		#endregion

		#region Overrides
		/// <summary>
		/// Create all controls. Notice that the creation is more than just instantiating the controls. It also involves
		/// in generating the underlying HTML so that the controls shows up per the need.
		/// </summary>
		protected override void CreateChildControls()
		{
			CreateControls();
			GenerateControlTree();
		}

		/// <summary>
		/// Initializes the cachepolicy. Create and cache a AgreementSearchContext object if necessary.
		/// Note that controls whose state must persist in the view state MUST be created BEFORE OnInit completes. We do
		/// this simply by invoking EnsureChildControls().
		/// </summary>
		/// <param name="e">Argument associated with the event</param>
		protected override void OnInit(EventArgs e)
		{
			cachePolicy = (Policy.ICachePolicy)Page.Session[Policy.Names.CachePolicyKey];
			AgreementSearchContext searchContext = cachePolicy.GetCachedObject(AgreementSearchContext.CacheKey) as AgreementSearchContext;
			if (searchContext == null)
			{
				searchContext = new AgreementSearchContext(cachePolicy);
				searchContext.Load(DataAccess.ConnectionString);
				searchContext.Cache();
			}

			EnsureChildControls();
			base.OnInit(e);
			searchContext.GetSearchCriteria(Page.Request.Url.ToString(), controlCollection);
		}

		/// <summary>
		/// Initialize the contents of all controls on first load. If the AgreementSearchContext is not cached yet, a
		/// new instance is created and cached.
		/// </summary>
		/// <param name="e">Argument associated with the event</param>
		protected override void OnLoad(EventArgs e)
		{
			try
			{
				if (!Page.IsPostBack)
				{
					AgreementSearchContext searchContext = (AgreementSearchContext)cachePolicy.GetCachedObject(AgreementSearchContext.CacheKey);

					LoadDropDownList(fundStatus, searchContext.FundStatusData, "StatusTypeID");
                    fundStatus.Items[0].Value = AllFundStatus;

					LoadDropDownList(agreementStatus, searchContext.AgreementStatusData, "StatusTypeID");

					CommonSearchContext commonSearchContext = (CommonSearchContext)cachePolicy.GetCachedObject(CommonSearchContext.CacheKey);
					SearchCriteria searchCriteria = commonSearchContext.GetSearchCriteria(Page.Request.Url.ToString());
					if (searchCriteria.Version == 0)
					{
                  try
                  {
                     if (ShowDefaultFund)
                        fundStatus.SelectedValue = ActiveFundStatus;
                     if (ShowDefaultAgreement)
                        agreementStatus.SelectedValue = AwardedAgreementStatus;
                  }
                  catch {}
					}

					LoadDropDownList(agreementType, searchContext.AgreementTypeData, "AgreementTypeID");
					LoadDropDownList(activityType, searchContext.ActivityTypeData, "ActivityCode");
					LoadDropDownList(location, searchContext.LocationData, "LocationID");
					LoadDropDownList(sponsorType, searchContext.SponsorTypeData, "SponsorTypeID");
                    LoadViewTypeDropDownList();
					SetControlState(searchContext.GetSearchCriteria(Page.Request.Url.ToString(), controlCollection));
				}
			}
			catch (Exception)
			{
				//the error will be returned and bubble up to the parent page if no agreement status
			}
		}

        private void LoadViewTypeDropDownList()
        {
           viewType.Items.Add(new ListItem(WebControls.Helper.SelectPrompt, "0"));
           viewType.Items.Add(new ListItem("Subcontract out", "1"));
           viewType.Items.Add(new ListItem("Patient care expense but no budget", "2"));
           viewType.Items.Add(new ListItem("Patient care budget but no expense","3"));
           //Tkt-9703-Add New Subcontract Budget Filters to Financial Summary
           viewType.Items.Add(new ListItem("Subcontract budget but no expense", "4"));
           viewType.Items.Add(new ListItem("Subcontract expense but no budget", "5"));
        
        }
		/// <summary>
		/// Set the state for all constituent controls, and register a client script block for the express purpose of
		/// validating the date ranges of all paired Calendar controls in this search block.
		/// </summary>
		/// <param name="e">Argument associated with the event</param>
		/// <remarks>
		/// <protocolId>Why are the actions taken in this method not being done on control load?</protocolId>
		/// <protocolId>During the non-postback construction of the control, the OnLoad method is invoked BEFORE the
		/// CreateChildControls method. The actual creation of constitutent controls are done within the context of
		/// the CreateChildControls methos. Setting the state of control relies on (obviously) the fact that the controls
		/// have been created. So, setting the state in OnLoad for the non-postback condition would fail.</protocolId>
		/// <protocolId>Interestingly, the sequence of method invocations reverses on postback: CreateChildControls is invoked
		/// before OnLoad.</protocolId>
		/// </remarks>
		protected override void OnPreRender(EventArgs e)
		{
			if (!IsDesignMode)
			{
				if (!Page.ClientScript.IsClientScriptBlockRegistered(Constants.ValidateDateRangeScriptKey))
				{
					string script = string.Format(
						"<script language=\"javascript\">\n" +
						"function ValidateDateRange()\n" +
						"{{\n" +
						"\tif (document.getElementById(\"{0}\") != null)\n" +
						"\t\tvar budgetStartText = document.getElementById(\"{0}\").value;\n" +
						"\tif (document.getElementById(\"{1}\") != null)\n" +
						"\t\tvar budgetEndText = document.getElementById(\"{1}\").value;\n" +
						"\tif (document.getElementById(\"{2}\") != null)\n" +
						"\t\tvar distributionStartText = document.getElementById(\"{2}\").value;\n" +
						"\tif (document.getElementById(\"{3}\") != null)\n" +
						"\t\tvar distributionEndText = document.getElementById(\"{3}\").value;\n" +
						"\tif (document.getElementById(\"{4}\") != null)\n" +
						"\t\tvar projectStartText = document.getElementById(\"{4}\").value;\n" +
						"\tif (document.getElementById(\"{5}\") != null)\n" +
						"\t\tvar projectEndText = document.getElementById(\"{5}\").value;\n" +
						"\tif (budgetStartText != null && budgetStartText != \"\" && budgetEndText != null && budgetEndText != \"\")\n" +
						"\t{{\n" +
						"\t\tvar budgetStartDate = new Date(budgetStartText);\n" +
						"\t\tvar budgetEndDate = new Date(budgetEndText);\n" +
						"\t\tif (budgetStartDate > budgetEndDate)\n" +
						"\t\t{{\n" +
						"\t\t\talert('Budget Start Date cannot be after Budget End Date.');\n" +
						"\t\t\tdocument.getElementById(\"{1}\").focus();\n" +
                        "\t\t\treturn false;\n" +
						"\t\t}}\n" +
                        "\t\treturn true;\n" +
						"\t}}\n" +
						"\tif (distributionStartText != null && distributionStartText != \"\" && distributionEndText != null && distributionEndText != \"\")\n" +
						"\t{{\n" +
						"\t\tvar distributionStartDate = new Date(distributionStartText);\n" +
						"\t\tvar distributionEndDate = new Date(distributionEndText);\n" +
						"\t\tif (distributionStartDate > distributionEndDate)\n" +
						"\t\t{{\n" +
						"\t\t\talert('Distribution Start Date cannot be after Distribution End Date.');\n" +
						"\t\t\tdocument.getElementById(\"{3}\").focus();\n" +
                        "\t\t\treturn false;\n" +
                        "\t\t}}\n" +
                        "\t\treturn true;\n" +
                        "\t}}\n" +
						"\tif (projectStartText != null && projectStartText != \"\" && projectEndText != null && projectEndText != \"\")\n" +
						"\t{{\n" +
						"\t\tvar projectStartDate = new Date(projectStartText);\n" +
						"\t\tvar projectEndDate = new Date(projectEndText);\n" +
						"\t\tif (projectStartDate > projectEndDate)\n" +
						"\t\t{{\n" +
						"\t\t\talert('Project Start Date cannot be after Project End Date.');\n" +
						"\t\t\tdocument.getElementById(\"{5}\").focus();\n" +
                        "\t\t\treturn false;\n" +
                        "\t\t}}\n" +
                        "\t\treturn true;\n" +
                        "\t}}\n" +
                        "\treturn true;\n" +
                        "}}\n" +
						"</script>\n",
						(budgetStartDate == null) ? "" : budgetStartDate.SelectedDateClientId,
						(budgetEndDate == null) ? "" : budgetEndDate.SelectedDateClientId,
                        (budgetEndFrom == null) ? "" : budgetEndFrom.SelectedDateClientId,
                        (budgetEndTo == null) ? "" : budgetEndTo.SelectedDateClientId,
						(distributionStartDate == null) ? "" : distributionStartDate.SelectedDateClientId,
						(distributionEndDate == null) ? "" : distributionEndDate.SelectedDateClientId,
						(projectStartDate == null) ? "" : projectStartDate.SelectedDateClientId,
						(projectEndDate == null) ? "" : projectEndDate.SelectedDateClientId,
                        (ProjectEndFrom == null) ? "" : ProjectEndFrom.SelectedDateClientId,
                        (ProjectEndTo == null) ? "" : ProjectEndTo.SelectedDateClientId);

					Page.ClientScript.RegisterClientScriptBlock(GetType( ), Constants.ValidateDateRangeScriptKey, script);
				}
			}

			base.OnPreRender(e);
		}

		#endregion

		#region Private Methods
		/// <summary>
		/// Create all controls in the AgreementSearch.
		/// </summary>
		private void CreateControls()
		{
			Controls.Clear();
			controlCollection = new ControlCollection(this);

			fundStatus = new DropDownList();
			fundStatus.ID = Constants.FundStatusIDKey;
			fundStatus.CssClass = "DataInput";
			fundStatus.Attributes["Label"] = "Fund Status";
			controlCollection.Add(fundStatus);
			agreementStatus = new DropDownList();
			agreementStatus.ID = Constants.AgreementStatusIDKey;
			agreementStatus.CssClass = "DataInput";
			agreementStatus.Attributes["Label"] = "Agreement Status";
			controlCollection.Add(agreementStatus);

			agreementType = new DropDownList();
			agreementType.ID = "agreementType";
			agreementType.CssClass = "DataInput";
			agreementType.Attributes["Label"] = "Agreement Type";
			controlCollection.Add(agreementType);

            sponsorNumber = new TextBox();
            sponsorNumber.ID = "sponsorNumber";
            sponsorNumber.CssClass = "DataInput";
            sponsorNumber.Attributes["Label"] = "Sponsor Number";
            controlCollection.Add(sponsorNumber);
            
            sponsorName = new TextBox();
			sponsorName.ID = "sponsorName";
			sponsorName.CssClass = "DataInput";
			sponsorName.Attributes["Label"] = "Sponsor Name";
			controlCollection.Add(sponsorName);

			activityType = new DropDownList();
			activityType.ID = "activityCode";
			activityType.CssClass = "DataInput";
			activityType.Attributes["Label"] = "Activity Type";
			controlCollection.Add(activityType);

			sponsorType = new DropDownList();
			sponsorType.ID = "sponsorType";
			sponsorType.CssClass = "DataInput";
			sponsorType.Attributes["Label"] = "Sponsor Type";
			controlCollection.Add(sponsorType);

			includeProgramProjects = new CheckBox();
			includeProgramProjects.ID = "includeProgramProjects";			
            //Changes done for TrackIT 7469
            includeProgramProjects.Text = "Related Projects Only";
            includeProgramProjects.Attributes["Label"] = "Related Projects Only";
			controlCollection.Add(includeProgramProjects);

			location = new DropDownList();
			location.ID = "location";
			location.CssClass = "DataInput";
			location.Attributes["Label"] = "Location";
			controlCollection.Add(location);

			projectStartDate = new Calendar();
			projectStartDate.ID = "projectStartDate";
			projectStartDate.Prompt = CommonSearch.SelectPrompt;
			projectStartDate.DropDownListNavigation = true;
			projectStartDate.Attributes["Label"] = "Project Start From Date";
			controlCollection.Add(projectStartDate);

			projectEndDate = new Calendar();
			projectEndDate.ID = "projectEndDate";
			projectEndDate.Prompt = CommonSearch.SelectPrompt;
            projectEndDate.Attributes["Label"] = "Project Start To Date";
			controlCollection.Add(projectEndDate);
            
            //Tkt-9704
            ProjectEndFrom = new Calendar();
            ProjectEndFrom.ID = "ProjectEndFrom";
            ProjectEndFrom.Prompt = CommonSearch.SelectPrompt;
            ProjectEndFrom.Attributes["Label"] = "Project End From Date";
            controlCollection.Add(ProjectEndFrom);
            ProjectEndTo = new Calendar();
            ProjectEndTo.ID = "ProjectEndTo";
            ProjectEndTo.Prompt = CommonSearch.SelectPrompt;
            ProjectEndTo.Attributes["Label"] = "Project End To Date";
            controlCollection.Add(ProjectEndTo);
            //Tkt-9704 End

			daysProjectEnding = new DropDownList();
			daysProjectEnding.ID = "daysProjectEnding";
			daysProjectEnding.CssClass = "DataInput";
			daysProjectEnding.Items.Add(CommonSearch.SelectPrompt);
			daysProjectEnding.Items.Add(new ListItem("30 Days", "30"));
			daysProjectEnding.Items.Add(new ListItem("60 Days", "60"));
			daysProjectEnding.Items.Add(new ListItem("90 Days", "90"));
			daysProjectEnding.SelectedIndex = 0;
			daysProjectEnding.Enabled = (daysProjectEnding.Items.Count > 1);
			daysProjectEnding.Attributes["Label"] = "Days Project Ending";
			controlCollection.Add(daysProjectEnding);

			bicsNumber = new TextBox();
			bicsNumber.ID = "bicsNumber";
			bicsNumber.CssClass = "DataInput";
			bicsNumber.Attributes["Label"] = "BICS Number";
			controlCollection.Add(bicsNumber);

			walkerNumber = new TextBox();
			walkerNumber.ID = "walkerNumber";
			walkerNumber.CssClass = "DataInput";
			walkerNumber.Attributes["Label"] = "Walker Number";
			controlCollection.Add(walkerNumber);

			budgetStartDate = new Calendar();
			budgetStartDate.ID = "budgetStartDate";
			budgetStartDate.Prompt = CommonSearch.SelectPrompt;
			budgetStartDate.Attributes["Label"] = "Budget Start From Date";
			controlCollection.Add(budgetStartDate);

			budgetEndDate = new Calendar();
			budgetEndDate.ID = "budgetEndDate";
			budgetEndDate.Prompt = CommonSearch.SelectPrompt;
			budgetEndDate.Attributes["Label"] = "Budget Start To Date";
			controlCollection.Add(budgetEndDate);

            //Tkt-9704
            budgetEndFrom = new Calendar();
            budgetEndFrom.ID = "budgetEndFrom";
            budgetEndFrom.Prompt = CommonSearch.SelectPrompt;
            budgetEndFrom.Attributes["Label"] = "Budget End From Date";
            controlCollection.Add(budgetEndFrom);

            budgetEndTo = new Calendar();
            budgetEndTo.ID = "budgetEndTo";
            budgetEndTo.Prompt = CommonSearch.SelectPrompt;
            budgetEndTo.Attributes["Label"] = "Budget End To Date";
            controlCollection.Add(budgetEndTo);
            //Tkt-9704 End

            daysBudgetEnding = new DropDownList();
			daysBudgetEnding.ID = "daysBudgetEnding";
			daysBudgetEnding.CssClass = "DataInput";
			daysBudgetEnding.Items.Add(CommonSearch.SelectPrompt);
			daysBudgetEnding.Items.Add(new ListItem("30 Days", "30"));
			daysBudgetEnding.Items.Add(new ListItem("60 Days", "60"));
			daysBudgetEnding.Items.Add(new ListItem("90 Days", "90"));
			daysBudgetEnding.SelectedIndex = 0;
			daysBudgetEnding.Enabled = (daysBudgetEnding.Items.Count > 1);
			daysBudgetEnding.Attributes["Label"] = "Days Budget Ending";
			controlCollection.Add(daysBudgetEnding);

			if (isSearchableByDistributionDates || IsDesignMode)
			{
				distributionEndDate = new Calendar();
				distributionEndDate.ID = "distributionEndDate";
				distributionEndDate.Prompt = CommonSearch.SelectPrompt;
				distributionEndDate.Visible = isSearchableByDistributionDates || IsDesignMode;
				distributionEndDate.Attributes["Label"] = "Distribution End Date";
				controlCollection.Add(distributionEndDate);

				distributionStartDate = new Calendar();
				distributionStartDate.ID = "distributionStartDate";
				distributionStartDate.Prompt = CommonSearch.SelectPrompt;
				distributionStartDate.Visible = isSearchableByDistributionDates || IsDesignMode;
				distributionStartDate.Attributes["Label"] = "Distribution Start Date";
				controlCollection.Add(distributionStartDate);
			}

			folderNumber = new TextBox();
			folderNumber.ID = "folderNumber";
			folderNumber.CssClass = "DataInput";
			folderNumber.Attributes["Label"] = "InfoEd Proposal Number";
			controlCollection.Add(folderNumber);

            projectTitle = new TextBox();
            projectTitle.ID = "projectTitle";
            projectTitle.CssClass = "DataInput";
            projectTitle.Attributes["Label"] = "Project Title";
            controlCollection.Add(projectTitle);

			daysFundCreated = new DropDownList();
			daysFundCreated.ID = "daysFundCreated";
			daysFundCreated.CssClass = "DataInput";
			daysFundCreated.Items.Add(CommonSearch.SelectPrompt);
			daysFundCreated.Items.Add(new ListItem("30 Days", "30"));
			daysFundCreated.Items.Add(new ListItem("60 Days", "60"));
			daysFundCreated.Items.Add(new ListItem("90 Days", "90"));
			daysFundCreated.SelectedIndex = 0;
			daysFundCreated.Enabled = (daysFundCreated.Items.Count > 1);
			daysFundCreated.Visible = isSearchableByBalance || IsDesignMode;
			daysFundCreated.Attributes["Label"] = "Fund Created Within";
			controlCollection.Add(daysFundCreated);

			balanceLessThan = new TextBox();
			balanceLessThan.ID = "balanceLessThan";
			balanceLessThan.CssClass = "DataInput";
			balanceLessThan.Visible = isSearchableByBalance || IsDesignMode;
			balanceLessThan.Attributes["Label"] = "Balance Less Than";
			controlCollection.Add(balanceLessThan);


			// set up the validator for balanceLessThan
			balanceLessThanValidator = new RegularExpressionValidator();
			balanceLessThanValidator.ErrorMessage = "Please enter a valid currency amount (no commas)";
			balanceLessThanValidator.Display = ValidatorDisplay.Static;
			balanceLessThanValidator.ControlToValidate = balanceLessThan.ID;
			// The following regular expression will match any positive or negative decimal value.
			// It expects one or two digits after a decimal point, but if
			// no decimal point was entered, it will still pass validation.
			balanceLessThanValidator.ValidationExpression = @"^[+-]?\d*[.]?\d{1,2}$";
			balanceLessThanValidator.EnableClientScript = true;

            //Tfs no:-408 Add the search parameter: "Balance Greater Than:-Start

            balanceGreaterThan = new TextBox();
            balanceGreaterThan.ID = "balanceGreaterThan";
            balanceGreaterThan.CssClass = "DataInput";
            balanceGreaterThan.Visible = isSearchableByBalance || IsDesignMode;
            balanceGreaterThan.Attributes["Label"] = "Balance Greater Than";
            controlCollection.Add(balanceGreaterThan);
            
            // set up the validator for balanceGreaterThan
            balanceGreaterThanValidator = new RegularExpressionValidator();
            balanceGreaterThanValidator.ErrorMessage = "Please enter a valid currency amount (no commas)";
            balanceGreaterThanValidator.Display = ValidatorDisplay.Static;
            balanceGreaterThanValidator.ControlToValidate = balanceGreaterThan.ID;
            // The following regular expression will match any positive or negative decimal value.
            // It expects one or two digits after a decimal point, but if
            // no decimal point was entered, it will still pass validation.
            balanceGreaterThanValidator.ValidationExpression = @"^[+-]?\d*[.]?\d{1,2}$";
            balanceGreaterThanValidator.EnableClientScript = true;

            //Tfs no:-408--End

            documentId = new TextBox();
            documentId.ID = "documentId";
            documentId.CssClass = "DataInput";
            documentId.Attributes["Label"] = "Document Id";
            controlCollection.Add(documentId);

            //VewType
            viewType = new DropDownList();
            viewType.ID = "viewType";
            viewType.CssClass = "DataInput";
            viewType.Attributes["Label"] = "viewType";
            controlCollection.Add(viewType);

			lastName = new TextBox();
			lastName.ID = "lastName";
			lastName.CssClass = "DataInput";
			lastName.Visible = isSearchableByName || IsDesignMode;
			lastName.Attributes["Label"] = "Last Name";
			controlCollection.Add(lastName);

			firstName = new TextBox();
			firstName.ID = "firstName";
			firstName.CssClass = "DataInput";
			firstName.Visible = isSearchableByName || IsDesignMode;
			firstName.Attributes["Label"] = "First Name";
			controlCollection.Add(firstName);
		}

		/// <summary>
		/// Setup the control tree to reflect the actual (and exact) layout of the controls within the CommonSearch.
		/// </summary>
		private void GenerateControlTree()
		{
			string searchClientId = ((Policy.ICachePolicy)Page.Session[Policy.Names.CachePolicyKey]).GetCachedObject(Constants.SearchButtonClientIDKey) as string;
			if (searchClientId == null)
				searchClientId = "expandingPanel_commonSearch_search";

			// Create a table with a single row and three columns. Each column hosts a table.

			Table t1 = new Table();
			t1.CssClass = "Search";
			t1.CellSpacing = t1.CellPadding = 5;
			t1.Attributes.Add("onkeypress", "return ClickButton(event, '" + searchClientId + "')");
			Controls.Add(t1);

			TableRow t1r1 = new TableRow();
			t1.Rows.Add(t1r1);

			// Create a table hosted by the first column of the second row of the first table. This table hosts the following:
			// Row 1 Column 1: Agreement/Fund Status label
			// Row 1 Column 2: Agreement/Fund Status drop-down-list
            // Row 2 Column 1: Sponsor Number label
            // Row 2 Column 2: Sponsor Number text-box
            // Row 3 Column 1: Sponsor Name label
			// Row 3 Column 2: Sponsor Name text-box
			// Row 4 Column 1: Sponsor Type label
			// Row 4 Column 2: Sponsor Type drop-down-list
			// Row 5 Column 1: Empty
			// Row 5 Column 2: Include Program Projects check-box
			// Row 6 Column 1: Last Name label
			// Row 6 Column 2: Last Name text-box
			// Row 7 Column 1: First Name label
			// Row 7 Column 2: First Name check-box

			TableCell t1r1c1 = new TableCell();
			t1r1c1.Attributes["valign"] = "top";
			t1r1.Cells.Add(t1r1c1);
			t1r1c1.Controls.Add(GenerateControlTreeForFirstSection());

			TableCell separator = new TableCell();
			separator.Attributes["style"] = "border-left: thin solid #c0c0c0";
			separator.Controls.Add(new LiteralControl("&nbsp;"));
			t1r1.Cells.Add(separator);

			// Create a table hosted by the second column of the second row of the first table. This table hosts the following:
			// Row 1 Column 1: Project Start/End label
			// Row 1 Column 2: Project Start/End calendars
			// Row 2 Column 1: Project Ending In label
			// Row 2 Column 2: Project Ending In drop-down-list
			// Row 3 Column 1: Budget Start/End label
			// Row 3 Column 2: Budget Start/End calendars
			// Row 4 Column 1: Budget Ending In label
			// Row 4 Column 2: Budget Ending In drop-down-list
			// Row 5 Column 1: Distribution Start/End label
			// Row 5 Column 2,3: Distribution Start/End calendars
			// Row 6 Column 1: Balance Less Than label
			// Row 6 Column 2: Balance Less Than text-box
            // Row 7 Column 1: Document Id label
            // Row 7 Column 2: Document Id text-box

			TableCell t1r1c2 = new TableCell();
			t1r1c2.Attributes["valign"] = "top";
			t1r1.Cells.Add(t1r1c2);
			t1r1c2.Controls.Add(GenerateControlTreeForSecondSection());

			separator = new TableCell();
			separator.Attributes["style"] = "border-left: thin solid #c0c0c0";
			separator.Controls.Add(new LiteralControl("&nbsp;"));
			t1r1.Cells.Add(separator);

			// Create a table hosted by the third column of the second row of the first table. This table hosts the following:
			// Row 1 Column 1: Agreement Type label
			// Row 1 Column 2: Agreement Type drop-down-list
			// Row 2 Column 1: Activity Type label
			// Row 2 Column 2: Activity Type drop-down-list
			// Row 3 Column 1: Location label
			// Row 3 Column 2: Location drop-down-list
			// Row 4 Column 1: Walker# label
			// Row 4 Column 2: Walker# text-box
			// Row 5 Column 1: BICS# label
			// Row 5 Column 2: BICS# text-box
			// Row 6 Column 1: Rex Folder# label
			// Row 6 Column 2: Rex Folder# text-box

			TableCell t1r1c3 = new TableCell();
			t1r1c3.Attributes["valign"] = "top";
			t1r1.Cells.Add(t1r1c3);
			t1r1c3.Controls.Add(GenerateControlTreeForThirdSection());
		}

		/// <summary>
		/// Create a table hosted by the first column of the first row of the first table. This table hosts the following:
		/// Row 1 Column 1: Agreement/Fund Status label
		/// Row 1 Column 2: Agreement/Fund Status drop-down-list
        /// Row 2 Column 1: Sponsor Number label
        /// Row 2 Column 2: Sponsor Number text-box
		/// Row 3 Column 1: Sponsor Name label
		/// Row 3 Column 2: Sponsor Name text-box
		/// Row 4 Column 1: Sponsor Type label
		/// Row 4 Column 2: Sponsor Type drop-down-list
		/// Row 5 Column 1: Empty
		/// Row 5 Column 2: Include Program Projects check-box
		/// Row 6 Column 1: Last Name label
		/// Row 6 Column 2: Last Name text-box
		/// Row 7 Column 1: First Name label
		/// Row 7 Column 2: First Name check-box
		/// </summary>
		/// <returns>Table containing the controls</returns>
		private Table GenerateControlTreeForFirstSection()
		{
			Table t = new Table();
			t.CssClass = "Search";
			t.CellSpacing = t.CellPadding = 5;

			TableRow r1 = new TableRow();
			t.Rows.Add(r1);

			TableCell r1c1 = new TableCell();
			r1c1.Attributes["align"] = "right";
			r1c1.Text = "<nobr>Agreement Status:&nbsp;</nobr>";
			r1.Cells.Add(r1c1);

			TableCell r1c2 = new TableCell();
			r1.Cells.Add(r1c2);
			r1c2.Controls.Add(agreementStatus);

			TableRow r1_1 = new TableRow();
			t.Rows.Add(r1_1);
			TableCell r1_1c1 = new TableCell();
			r1_1c1.Attributes["align"] = "right";
			r1_1c1.Text = "<nobr>Fund Status:&nbsp;</nobr>";
			r1_1.Cells.Add(r1_1c1);
			TableCell r1_1c2 = new TableCell();
			r1_1.Cells.Add(r1_1c2);
			r1_1c2.Controls.Add(fundStatus);

            TableRow r1_2 = new TableRow();
            t.Rows.Add(r1_2);
            TableCell r1_2c1 = new TableCell();
            r1_2c1.Attributes["align"] = "right";
            r1_2c1.Text = "<nobr>Sponsor #:&nbsp;</nobr>";
            r1_2.Cells.Add(r1_2c1);
            TableCell r1_2c2 = new TableCell();
            r1_2.Cells.Add(r1_2c2);
            r1_2c2.Controls.Add(sponsorNumber);
            
            TableRow r2 = new TableRow();
			t.Rows.Add(r2);

			TableCell r2c1 = new TableCell();
			r2c1.Attributes["align"] = "right";
			r2.Cells.Add(r2c1);
			r2c1.Text = "<nobr>Sponsor Name:&nbsp;</nobr>";

			TableCell r2c2 = new TableCell();
			r2.Cells.Add(r2c2);
			r2c2.Controls.Add(sponsorName);

			TableRow r3 = new TableRow();
			t.Rows.Add(r3);

			TableCell r3c1 = new TableCell();
			r3c1.Attributes["align"] = "right";
			r3.Cells.Add(r3c1);
			r3c1.Text = "<nobr>Sponsor Type:&nbsp;</nobr>";

			TableCell r3c2 = new TableCell();
			r3.Cells.Add(r3c2);
			r3c2.Controls.Add(sponsorType);

			TableRow r4 = new TableRow();
			t.Rows.Add(r4);
			TableCell r4c1 = new TableCell();
			r4.Cells.Add(r4c1);

			TableCell r4c2 = new TableCell();
			r4.Cells.Add(r4c2);
			r4c2.Controls.Add(includeProgramProjects);

            TableRow r7 = new TableRow();
            t.Rows.Add(r7);
            r7.BorderColor = System.Drawing.Color.Red;
            TableCell r7c1 = new TableCell();
            r7c1.Attributes["align"] = "right";
            r7.Cells.Add(r7c1);
            r7c1.Text = "<nobr>Project Title:&nbsp;</nobr>";

            TableCell r7c2 = new TableCell();
            r7.Cells.Add(r7c2);
            r7c2.Controls.Add(projectTitle);

			if (isSearchableByName || IsDesignMode)
			{
				TableRow r5 = new TableRow();
				t.Rows.Add(r5);

				TableCell r5c1 = new TableCell();
				r5c1.Attributes["align"] = "right";
				r5.Cells.Add(r5c1);
				r5c1.Text = "<nobr>Last Name:&nbsp;</nobr>";

				TableCell r5c2 = new TableCell();
				r5.Cells.Add(r5c2);
				r5c2.Controls.Add(lastName);

				TableRow r6 = new TableRow();
				t.Rows.Add(r6);

				TableCell r6c1 = new TableCell();
				r6c1.Attributes["align"] = "right";
				r6.Cells.Add(r6c1);
				r6c1.Text = "<nobr>First Name:&nbsp;</nobr>";

				TableCell r6c2 = new TableCell();
				r6.Cells.Add(r6c2);
				r6c2.Controls.Add(firstName);

              

			}

			return t;
		}

		/// <summary>
		/// Create a table hosted by the second column of the first row of the first table. This table hosts the following:
		/// Row 1 Column 1: Project Start/End label
		/// Row 1 Column 2,3: Project Start/End calendars
		/// Row 2 Column 1: Project Ending In label
		/// Row 2 Column 2: Project Ending In drop-down-list
		/// Row 3 Column 1: Budget Start/End label
		/// Row 3 Column 2,3: Budget Start/End calendars
		/// Row 4 Column 1: Budget Ending In label
		/// Row 4 Column 2: Budget Ending In drop-down-list
		/// Row 5 Column 1: Distribution Start/End label
		/// Row 5 Column 2,3: Distribution Start/End calendars
		/// Row 6 Column 1: Balance Less Than label
		/// Row 6 Column 2: Balance Less Than text-box
		/// </summary>
		/// <returns>Table containing the controls</returns>
		private Table GenerateControlTreeForSecondSection()
		{
			Table t = new Table();
			t.CssClass = "Search";
			t.CellSpacing = t.CellPadding = 5;

			TableRow r1 = new TableRow();
			t.Rows.Add(r1);

			TableCell r1c1 = new TableCell();
			r1c1.Attributes["align"] = "right";
			r1c1.Text = "<nobr>Project Start Date From/To:&nbsp;</nobr>";
			r1.Cells.Add(r1c1);

			TableCell r1c2 = new TableCell();
			r1.Cells.Add(r1c2);
            r1c2.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)projectStartDate);
			TableCell r1c3 = new TableCell();
			r1.Cells.Add(r1c3);
            r1c3.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)projectEndDate);

            //Tkt-9704
            TableRow r11 = new TableRow();
            t.Rows.Add(r11);
            TableCell r11c1 = new TableCell();
            r11c1.Attributes["align"] = "right";
            r11.Cells.Add(r11c1);
            r11c1.Text = "<nobr>Project End Date From/To:&nbsp;</nobr>";

            TableCell r11c2 = new TableCell();
            r11.Cells.Add(r11c2);
            r11c2.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)ProjectEndFrom);

            TableCell r11c3 = new TableCell();
            r11.Cells.Add(r11c3);
            r11c3.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)ProjectEndTo);
            //Tkt-9704 End
        

			TableRow r2 = new TableRow();
			t.Rows.Add(r2);

			TableCell r2c1 = new TableCell();
			r2c1.Attributes["align"] = "right";
			r2.Cells.Add(r2c1);
			r2c1.Text = "<nobr>Project Ending In:&nbsp;</nobr>";

			TableCell r2c2 = new TableCell();
			r2.Cells.Add(r2c2);
			r2c2.Controls.Add(daysProjectEnding);

			TableRow r3 = new TableRow();
			t.Rows.Add(r3);

			TableCell r3c1 = new TableCell();
			r3c1.Attributes["align"] = "right";
			r3.Cells.Add(r3c1);
			r3c1.Text = "<nobr>Budget Start Date From/To:&nbsp;</nobr>";

			TableCell r3c2 = new TableCell();
			r3.Cells.Add(r3c2);
            r3c2.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)budgetStartDate);

            TableCell r3c3 = new TableCell();
            r3.Cells.Add(r3c3);
            r3c3.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)budgetEndDate);

            //TKT-9704 
            TableRow r10 = new TableRow();
            t.Rows.Add(r10);
            TableCell r10c1 = new TableCell();
            r10c1.Attributes["align"] = "right";
            r10.Cells.Add(r10c1);
            r10c1.Text = "<nobr>Budget End Date From/To:&nbsp;</nobr>";

            TableCell r10c2 = new TableCell();
            r10.Cells.Add(r10c2);
            r10c2.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)budgetEndFrom);

            TableCell r10c3 = new TableCell();
            r10.Cells.Add(r10c3);
            r10c3.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)budgetEndTo);
            //TKT-9704 End

			TableRow r4 = new TableRow();
			t.Rows.Add(r4);

			TableCell r4c1 = new TableCell();
			r4c1.Attributes["align"] = "right";
			r4.Cells.Add(r4c1);
			r4c1.Text = "<nobr>Budget Ending In:&nbsp;</nobr>";

			TableCell r4c2 = new TableCell();
			r4.Cells.Add(r4c2);
			r4c2.Controls.Add(daysBudgetEnding);

			if (isSearchableByDistributionDates || IsDesignMode)
			{
				TableRow r5 = new TableRow();
				t.Rows.Add(r5);

				TableCell r5c1 = new TableCell();
				r5c1.Attributes["align"] = "right";
				r5.Cells.Add(r5c1);
				r5c1.Text = "<nobr>Distribution Start/End:&nbsp;</nobr>";

				TableCell r5c2 = new TableCell();
				r5.Cells.Add(r5c2);
                r5c2.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)distributionStartDate);

				TableCell r5c3 = new TableCell();
				r5.Cells.Add(r5c3);
                r5c3.Controls.Add(IsDesignMode ? (Control)new LiteralControl(Calendar.DesignTimeHTML) : (Control)distributionEndDate);
			}

			if (isSearchableByBalance || IsDesignMode)
			{
				TableRow r6 = new TableRow();
				t.Rows.Add(r6);

				TableCell r6c1 = new TableCell();
				r6c1.Attributes["align"] = "right";
				r6.Cells.Add(r6c1);
				r6c1.Text = "<nobr>Fund Created Within:&nbsp;</nobr>";

				TableCell r6c2 = new TableCell();
				r6.Cells.Add(r6c2);
				r6c2.Controls.Add(daysFundCreated);

				TableRow r7 = new TableRow();
				t.Rows.Add(r7);

				TableCell r7c1 = new TableCell();
				r7c1.Attributes["align"] = "right";
				r7.Cells.Add(r7c1);
				r7c1.Text = "<nobr>Balance Less Than:&nbsp;</nobr>";

				TableCell r7c2 = new TableCell();
				r7.Cells.Add(r7c2);
				r7c2.Controls.Add(balanceLessThan);

                //TFS 408 Add Balance Greater Than--Start

                TableRow r12 = new TableRow();
                t.Rows.Add(r12);

                TableCell r12c1 = new TableCell();
                r12c1.Attributes["align"] = "right";
                r12.Cells.Add(r12c1);
                r12c1.Text = "<nobr>Balance Greater Than:&nbsp;</nobr>";

                TableCell r12c2 = new TableCell();
                r12.Cells.Add(r12c2);
                r12c2.Controls.Add(balanceGreaterThan);
                
                //TFS 408 End

                TableRow r8 = new TableRow();
                t.Rows.Add(r8);

                TableCell r8c1 = new TableCell();
                r8c1.Attributes["align"] = "right";
                r8.Cells.Add(r8c1);
                r8c1.Text = "<nobr>Document Id:&nbsp;</nobr>";

                TableCell r8c2 = new TableCell();
                r8.Cells.Add(r8c2);
                r8c2.Controls.Add(documentId);
                              

                TableRow r13 = new TableRow();
                t.Rows.Add(r13);

                TableCell r13c1 = new TableCell();
                r13c1.Attributes["align"] = "middle";
                r13c1.ColumnSpan = 4;
                r13.Cells.Add(r13c1);
                r13c1.Controls.Add(balanceGreaterThanValidator);

                //TFS 408 Add Balance Greater Than--Start

				TableRow r9 = new TableRow();
				t.Rows.Add(r9);

				TableCell r9c1 = new TableCell();
				r9c1.Attributes["align"] = "middle";
				r9c1.ColumnSpan = 4;
				r9.Cells.Add(r9c1);
				r9c1.Controls.Add(balanceLessThanValidator);
                //TFS 408-End
			}

			return t;
		}

		/// <summary>
		// Create a table hosted by the third column of the second row of the first table. This table hosts the following:
		// Row 1 Column 1: Agreement Type label
		// Row 1 Column 2: Agreement Type drop-down-list
		// Row 2 Column 1: Activity Type label
		// Row 2 Column 2: Activity Type drop-down-list
		// Row 3 Column 1: Location label
		// Row 3 Column 2: Location drop-down-list
		// Row 4 Column 1: Walker# label
		// Row 4 Column 2: Walker# text-box
		// Row 5 Column 1: BICS# label
		// Row 5 Column 2: BICS# text-box
		// Row 6 Column 1: Rex Folder# label
		// Row 6 Column 2: Rex Folder# text-box
		/// </summary>
		/// <returns>Table containing the controls</returns>
		private Table GenerateControlTreeForThirdSection()
		{
			Table t = new Table();
			t.CssClass = "Search";
			t.CellSpacing = t.CellPadding = 5;

			TableRow r1 = new TableRow();
			t.Rows.Add(r1);

			TableCell r1c1 = new TableCell();
			r1c1.Attributes["align"] = "right";
			r1c1.Text = "<nobr>Agreement Type:&nbsp;</nobr>";
			r1.Cells.Add(r1c1);

			TableCell r1c2 = new TableCell();
			r1.Cells.Add(r1c2);
			r1c2.Controls.Add(agreementType);

			TableRow r2 = new TableRow();
			t.Rows.Add(r2);

			TableCell r2c1 = new TableCell();
			r2c1.Attributes["align"] = "right";
			r2.Cells.Add(r2c1);
			r2c1.Text = "<nobr>Activity Type:&nbsp;</nobr>";

			TableCell r2c2 = new TableCell();
			r2.Cells.Add(r2c2);
			r2c2.Controls.Add(activityType);

			TableRow r3 = new TableRow();
			t.Rows.Add(r3);

			TableCell r3c1 = new TableCell();
			r3c1.Attributes["align"] = "right";
			r3.Cells.Add(r3c1);
			r3c1.Text = "<nobr>Location:&nbsp;</nobr>";

			TableCell r3c2 = new TableCell();
			r3.Cells.Add(r3c2);
			r3c2.Controls.Add(location);

			TableRow r4 = new TableRow();
			t.Rows.Add(r4);

			TableCell r4c1 = new TableCell();
			r4c1.Attributes["align"] = "right";
			r4.Cells.Add(r4c1);
			r4c1.Text = "<nobr>Walker #:&nbsp;</nobr>";

			TableCell r4c2 = new TableCell();
			r4.Cells.Add(r4c2);
			r4c2.Controls.Add(walkerNumber);

			TableRow r5 = new TableRow();
			t.Rows.Add(r5);

			TableCell r5c1 = new TableCell();
			r5c1.Attributes["align"] = "right";
			r5.Cells.Add(r5c1);
			r5c1.Text = "<nobr>BICS #:&nbsp;</nobr>";

			TableCell r5c2 = new TableCell();
			r5.Cells.Add(r5c2);
			r5c2.Controls.Add(bicsNumber);

			TableRow r6 = new TableRow();
			t.Rows.Add(r6);

			TableCell r6c1 = new TableCell();
			r6c1.Attributes["align"] = "right";
			r6.Cells.Add(r6c1);
			r6c1.Text = "<nobr>InfoEd Proposal #:&nbsp;</nobr>";

			TableCell r6c2 = new TableCell();
			r6.Cells.Add(r6c2);
			r6c2.Controls.Add(folderNumber);
           
            TableRow r7 = new TableRow();
            t.Rows.Add(r7);

            TableCell r7c1 = new TableCell();
            r7c1.Attributes["align"] = "right";
            r7.Cells.Add(r7c1);
            r7c1.Text = "<nobr>View:&nbsp;</nobr>";

            TableCell r7c2 = new TableCell();
            r7.Cells.Add(r7c2);
            r7c2.Controls.Add(viewType);
			return t;
		}
		#endregion

		#region Internal Methods
		/// <summary>
		/// This method is ONLY invoked by the associated designer to show the control contents at design time.
		/// </summary>
		internal void Design()
		{
			EnsureChildControls();
		}
		#endregion
	}
	#endregion

	#region Class PagerDesigner
	/// <summary>
	/// Designer associated with the AgreementSearch control.
	/// </summary>
	/// <remarks>
	/// This class cannot be used directly.
	/// </remarks>
	public class AgreementSearchDesigner : ControlDesigner
	{
		#region Overrides
		/// <summary>
		/// Force the control to create its child controls for display at design time.
		/// </summary>
		/// <returns>HTML representation of the control</returns>
		public override string GetDesignTimeHtml()
		{
			((AgreementSearch)Component).Design();
			return base.GetDesignTimeHtml();
		}
		#endregion
	}
	#endregion
}

// --- EOF ---
